﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class GUI_ViewMessage : System.Web.UI.Page
{
    string username;
    int userid;
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["uid"] == null)
        {
            Response.Redirect("../GUI/Home.aspx");
        }
        else
        {
            username = Session["uid"].ToString();
            userid = ToolsDT.getUserID(username);
            DataTable dt = ToolsDT.ViewMessage(userid);
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
    }
}
